﻿#ifndef MYLINEEDIT_H
#define MYLINEEDIT_H
#pragma execution_character_set("utf-8")
#include <QWidget>
#include<QLineEdit>
#include<QContextMenuEvent>
#include<QMenu>
#include<QPoint>

class MyLineEdit : public QLineEdit, public QContextMenuEvent
{
    Q_OBJECT

protected:
    // 重写一个菜单的事件
    void contextMenuEvent(QContextMenuEvent *event) override;
public:
    MyLineEdit( QWidget * parent =nullptr, Reason reason= QContextMenuEvent::Mouse,const QPoint & point= QCursor::pos());
private slots:
    void onAcTrid();
private:
   static  QMenu *menu;
  static  QAction *action;
};

#endif // MYLINEEDIT_H
